# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: John D Jones III AKA jnbek <jnbek1972 -_AT_- g m a i l -_Dot_- com>

_pkg="Search-Xapian"
pkgname='perl-search-xapian'
pkgver='1.2.25.5'
pkgrel=3
pkgdesc="Perl XS frontend to the Xapian C++ search library."
arch=('loong64' 'x86_64')
url='https://metacpan.org/release/Search-Xapian'
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl' 'perl-devel-leak' 'xapian-core')
source=("https://search.cpan.org/CPAN/authors/id/O/OL/OLLY/Search-Xapian-$pkgver.tar.gz")
sha512sums=('3099ba3f8726029d7a5c916f6b05d2d7cea41534b0f364687c7d9e0212340dca2a313a1ac8e0f6531a7c1084c8833a0e6d45bcff8fec32e0a6e5922bc0bcb81f')

build() {
  cd "$_pkg-${pkgver}"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

check() {
  cd "$_pkg-${pkgver}"
  export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
  make test
}

package() {
  cd "$_pkg-${pkgver}"
  make INSTALLDIRS=vendor DESTDIR="$pkgdir" install
}
